function loadEdition(propertyId,onClickFunction){
	var defaultValue = $('#'+propertyId+' > *[name|="default"]').text();
	var actualValue = $('#'+propertyId+' > *[name|="value"]').text();
	showEdition(defaultValue, propertyId, actualValue, onClickFunction);
}

function showEdition(defaultValue, propertyId, actualValue,onClickFunction){
	
	var edition = $('<div id="edition" class="edition-table"></div>');
	$(edition).append(createRowCell(Keys.DEFAULT_VALUE));
	$(edition).append(createRowCell(defaultValue));
	$(edition).append(createRowCell('<textarea id="newValue" rows="10" cols="50" >'+actualValue+'</textarea>'));
	$(edition).append(createButtons(propertyId, onClickFunction));
	
	
	$('body > #edition').remove();
	$('body').append(edition);
}

function createRowCell(element){
	var row = createRow();
	var cell = createCell();
	$(cell).append(element);
	$(row).append(cell);
	return row;
}

function createRow(){
	var row = $('<span class="edition-row"></span>');
	return row;
}

function createCell(){
	var cell = $('<span class="edition-cell"></span>');
	return cell;
}

function createButtons(propertyId, onClickFunction){
	var row = createRow();
	var cell = createCell();
	var butonCreate = $('<input type="button" value="'+Keys.EDIT+'"/>');
	butonCreate.click( 
			function clickFunction(){
				onClickFunction(propertyId,$('#newValue').val());
				$('body > #edition').remove();
			});
	
	var butonClose = $('<input type="button" value="'+Keys.CLOSE+'"/>');
	butonClose.click( 
			function clickFunction(){
				$('body > #edition').remove();
			});
	
	$(cell).append(butonCreate);
	$(cell).append(butonClose);
	$(row).append(cell);
	return row;
}
